﻿@model BlogLite.Models.Database.Post

@{ ViewBag.Title = Model.Subject; }

<div class="left" id="content_outer">
	<div id="content">                   
        <div class="post">
			<div class="post_title"><h2><a href="/Post/@Model.PostId">@Model.Subject</a></h2></div>
			<div class="post_date">Posted on @Model.PostDate.ToShortDateString() by @Model.User.DisplayName</div>
			<div class="post_body">
				@Html.Raw(Model.Content)
			</div>
			<div class="post_meta">
				<a href="#">@Model.Comments.Count comments</a> | Tagged:         
                @foreach (var tags in Model.Tags) {
                    @tags.TagName @:&nbsp;                         
                }                        
			</div>
            <div class="cleaner">&nbsp;</div>
            <h3 class="left">Comments</h3>
            <p class="right">
                <a href="#reply">Leave a reply »</a>
            </p>
            <div class="cleaner">&nbsp;</div>
            <div class="comment_list">
                @{
                   foreach (var comment in Model.Comments) {
                       <div class="comment alt">
                            <div class="comment_gravatar left">
                                <img height="32" width="32" src="@Url.Content("~/Content/Images/sampleGravatar.jpg")" alt="" />
                            </div>
                            <div class="comment_author left">
                                @comment.Name
                                <div class="comment_date">
                                    @comment.CommentDate.ToLongDateString() at @comment.CommentDate.ToShortTimeString()
                                </div>
                            </div>
                            <div class="cleaner">&nbsp;</div>
                            <div class="comment_body">
                                <p>
                                    @comment.CommentContent
                                </p>
                            </div>
                       </div>
                   }                    
                }
            </div>
            <div class="clearer">&nbsp;</div>
            @using (Html.BeginForm()) 
            {
	            <fieldset>
		            <div class="legend">
			            <h3>Leave a Reply</h3>
		            </div>
		            <div class="form_row">
			            <div class="form_property form_required">Your name</div>
			            <div class="form_value">
				            <input type="text" value="" name="name" size="32" />
			            </div>
			            <div class="clearer">&nbsp;</div>
		            </div>
		            <div class="form_row">
			            <div class="form_property">Email</div>
			            <div class="form_value">
    				        <input type="text" value="" name="email" size="32" />
			            </div>
			            <div class="clearer">&nbsp;</div>
		            </div>
                    <div class="form_row">
                        <div class="form_property">Website</div>
                        <div class="form_value">
                            <input type="text" value="" name="website" size="32" />
                        </div>
                        <div class="clearer">&nbsp;</div>
                    </div>
                    <div class="form_row">
                        <div class="form_property form_required">Comment</div>
                        <div class="form_value">
                            <textarea name="comment" cols="46" rows="10"></textarea>
                        </div>
                        <div class="clearer">&nbsp;</div>
                    </div>
                    <div class="form_row form_row_submit">
                        <div class="form_value">
                            <input class="button" type="submit" value="Submit Comment »">
                        </div>
                        <div class="clearer">&nbsp;</div>
                    </div>
                </fieldset>
            }
		</div>            
	</div>
</div>
<div class="right" id="sidebar_outer">
	<div id="sidebar">
		<div class="box">
            @{ 
                // We'll need to make this section configurable in the admin                
            }
			<div class="box_title">About</div>
			<div class="box_content">
				<p></p>
			</div>
		</div>
		<div class="box">
			<div class="box_title">Tags</div>
			<div class="box_content">
				<ul>
					@{
                        // Need to think really hard about if we want to use the ViewBag for this
                        // if we implement other pages that use this section, the ViewBag is probably
                        // the best place for this instead of duplicating this in a ViewModel.  
                        // ** Ethan just loves <dynamic> **
                        foreach (var tag in ViewBag.Tags as IEnumerable<BlogLite.Models.Database.Tag>)
                        {
                            @Html.ActionLink(tag.TagName, "/", new { controller = "Tags", action = "Index", id = @tag.TagName })<br />
                        }
                     }
				</ul>
			</div>
		</div>
		<div class="box">
			<div class="box_title">Ads</div>
			<div class="box_content">
				<ul>					
				</ul>
			</div>
		</div>		
	</div>
</div>
<div class="clearer">&nbsp;</div>